{% extends 'base2.html' %}

{% block title %}注册{% endblock %}
{% block content %}
    <div class="container" style="height: 600px">
        <div class="col-md-4 col-md-offset-4">
            <form class='form-register' action="/register/" method="post">

                {% if msg %}
                    <div class="alert alert-warning">{{ msg }}</div>
                {% endif %}

                {% csrf_token %}

                <h2 class="text-center">欢迎注册</h2>
                <div class="form-group">
                    {{ register_form.username.label_tag }}
                    {{ register_form.username }}
                    {{ register_form.username.errors }}
                    <p id="checkUsername"></p>
                </div>
                <div class="form-group">
                    {{ register_form.password1.label_tag }}
                    {{ register_form.password1 }}
                    {{ register_form.password1.errors }}
                </div>
                <div class="form-group">
                    {{ register_form.password2.label_tag }}
                    {{ register_form.password2 }}
                    {{ register_form.password2.errors }}
                </div>
                <div class="form-group">
                    {{ register_form.name.label_tag }}
                    {{ register_form.name }}
                    {{ register_form.name.errors }}
                </div>
                <div class="form-group">
                    {{ register_form.captcha.label_tag }}
                    {{ register_form.captcha }}
                    {{ register_form.captcha.errors }}
                </div>

                <button type="reset" class="btn btn-default pull-left">重置</button>
                <button type="submit" class="btn btn-primary pull-right">注册</button>

            </form>
        </div>
    </div> <!-- /container -->
{% endblock %}